// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

@require '~styl/base/palette.styl'
@require '~src/views/shared/util/table.styl'

.sort-table
  @extend $table-base

  .sort-table__cell--header
    border-right 1px solid $table-border
    width 250px

  &__row--header
    background-color $background-color
    border-bottom 1px solid $table-border
    // Display the sort direction arrow in header cells.
    .sort-table__cell
      position relative
      font-family SourceSansPro-SemiBold
      font-size 12px
      font-weight 600
      line-height 1.17
      letter-spacing 1.5px
      color $placeholder
      .sortable__actions
        position relative
        padding 11px
        &:after, &:before
          content ""
          position absolute
          right 5px
          width 0
          height 0
          border-style solid
        &:after
          top 12px
          border-width 0 3px 3.8px 3px
          border-color transparent transparent $grey-light transparent
        &:before
          bottom 12px
          border-width 3.8px 3px 0 3px;
          border-color $grey-light transparent transparent transparent

      &--descending
        color $body-color
        .sortable__actions:before
          border-color $blue transparent transparent transparent

      &--ascending
        color $body-color
        .sortable__actions:after
          border-color transparent transparent $blue transparent

  &__unbounded-column
    white-space normal
    word-break break-all

  &__row
    border-top 1px solid transparent
    border-bottom 1px solid $table-border 
    &.drawer-active
      background-color $background-color
      .cl-table-link__tooltip
        color $main-blue-color
        text-decoration underline
    &--expandable
      border-top: none
      cursor pointer

  &__cell__expansion-control
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */

    div
      width 15px

.table__no-results
  display flex
  justify-content center
  align-items center
  flex-direction column
  padding 50px 0
  p
    font-family SourceSansPro-Regular
    font-size 16px
    line-height 1.5
    color $colors--neutral-8
    margin 0
  a
    font-family SourceSansPro-Regular
    font-size 14px
    line-height 1.57
    letter-spacing 0.1px
    color $colors--primary-blue-3

.cl-table-link__description
  font-size $font-size--small
  line-height 22px
  color $colors--neutral-1
  white-space pre-wrap